import { S } from '../s';
import { IPSAjaxControl } from './ipsajax-control';
import { IPSControlAction } from './ipscontrol-action';
import { IPSControlContainer } from './ipscontrol-container';
import { PSControlContainerImpl } from './pscontrol-container-impl';

export class PSAjaxControlContainerImpl
  extends PSControlContainerImpl
  implements IPSControlContainer, IPSAjaxControl
{
  protected user2pscontrolaction: IPSControlAction;
  getUser2PSControlAction(): IPSControlAction | null {
    return (
      this.user2pscontrolaction ||
      (this.user2pscontrolaction = this.fillObjectModel(
        S._92,
        this.M.getUser2PSControlAction,
        S._337,
      ) as IPSControlAction)
    );
  }

  protected userpscontrolaction: IPSControlAction;
  getUserPSControlAction(): IPSControlAction | null {
    return (
      this.userpscontrolaction ||
      (this.userpscontrolaction = this.fillObjectModel(
        S._92,
        this.M.getUserPSControlAction,
        S._338,
      ) as IPSControlAction)
    );
  }

  get autoLoad(): boolean {
    return this.M.autoLoad != null ? this.M.autoLoad : true;
  }

  get enableItemPrivilege(): boolean {
    return this.M.enableItemPrivilege != null
      ? this.M.enableItemPrivilege
      : false;
  }

  get showBusyIndicator(): boolean {
    return this.M.showBusyIndicator != null ? this.M.showBusyIndicator : true;
  }
  get cls(): string {
    return 'PSAjaxControlContainerImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._217 || cls == S._214) return true;
    return super.instanceof(cls);
  }
}
